function IR = cartesianas4(I)
 [F C] = size(I);
 IR = zeros(F,C);
 Om = (F+1)/2;                  % coordenadas del centro de la imagen
 On = (C+1)/2;
 sx = (F-1)/2;                  % factores de escala
 sy = (C-1)/2;
 
 M=64;
 N=360;
  
 R=0.5;
 a=2^(1/M);
 rmin=(a^(-M/2))*R;
 rmax=(a^(M/2))*R;

for xi = 1:F
  for yi = 1:C
    x = (xi - Om)/sx;
    y = ((-1)*yi + On)/sy;
     
    %x = (xi - Om)/sx;
    %y = (yi - On)/sy;
     
     r= sqrt(x^2 + y^2);
     
      
     if (r >=rmin) && (r <=rmax)
        
        theta = atan2(y,x);
        
        l1 =abs(floor((log(r/R)/(log(a)))+M/2));
        l2 =abs(floor((N*theta)/pi));
          
        if(l1>=1 && l1<=M) && (l2>=1 && l2<=N)
          IR (xi, yi) = 1;
         % IR (xi, yi) = I(l1,l2);
         %  IR (l1,l2) =1;    
        end
      end 
  end
end
end